/**
 * 显示图标 
 * @returns
 */
function showIcons() {
	var index = layer
			.open({
				type : 2,
				title : false, // '菜单管理',
				closeBtn : 0,
				shadeClose : true,
				shade : 0.8,
				area : [ '50%', '95%' ],
				content : ctx + 'pages/portal/ucenter/project/icons?id=1',
				btn : [ '确认', '取消' ],
				yes : function(index, layero) {
					console.log("index = " + index + " layero = " + layero);
					var selectResourceParentNode = $(layero).find("iframe")[0].contentWindow.document.getElementById("selectResourceParentNode")
					
					var resourceSrc = $(selectResourceParentNode).attr("src");
					
					$("span#applicationIconsLabel").html('<img src="'+resourceSrc+'" style="width:60px" class="' + resourceSrc+ '" aria-hidden="true"></img>');
					$("input#applicationIcons").val(resourceSrc);

					layer.close(index);
				}
			});
}

/**
 * 显示应用
 * @returns
 */
function showApplication(){
	var index = layer.open({
		type : 2,
		title : false , //'菜单管理',
		closeBtn:0 ,
		shadeClose : true,
		shade : 0.8,
		area : [ '50%', '95%' ],
		content : ctx+'portal/ucenter/project/select' , 
		btn: ['确认', '取消'] , 
		yes: function(index, layero){
			console.log("index = " + index + " layero = " + layero) ; 
			var selectResourceParentNode = $(layero).find("iframe")[0].contentWindow.document.getElementById("selectResourceParentNode")
			
			var resourceName = $(selectResourceParentNode).attr("data-applicationName") ; 	
			var id = $(selectResourceParentNode).attr("data-id") ; 	
			
			console.log("applicationId = " + id + " , applicationIdLabel = " + resourceName) ;
			
			$("input[name=applicationIdLabel]").val(resourceName) ; 
			$("input[name=applicationId]").val(id) ; 
			
			if($.fn.zTree != null){
				var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
				treeObj.reAsyncChildNodes(null, "refresh");
			}
			
			layer.close(index) ; 
	 	}
	});		
}

/**
 * 显示Font图标 
 * @returns
 */
function showFontIcons(target, fontSize) {
	var index = layer
			.open({
				type : 2,
				title : false, // '菜单管理',
				closeBtn : 0,
				shadeClose : true,
				shade : 0.8,
				area : [ '50%', '95%' ],
				content : ctx + 'pages/portal/common/fontIcons?id=1',
				btn : [ '确认', '取消' ],
				yes : function(index, layero) {
					console.log("index = " + index + " layero = " + layero);
					var selectResourceParentNode = $(layero).find("iframe")[0].contentWindow.document.getElementById("selectResourceParentNode")
					
					var resourceSrc = $(selectResourceParentNode).attr("src");
					
					$("span#"+target+"Label").html('<i  class="'+resourceSrc+'" style="font-size:'+fontSize+'px" class="' + resourceSrc+ '" aria-hidden="true"></i>');
					$("input#" + target).val(resourceSrc);

					layer.close(index);
				}
			});
}
